<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/12
 * Time: 17:30
 */

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller;
use App\Models\Article;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class ArticleController extends Controller
{
    public function index(Article $articleModel){
        $res = $articleModel::get();
        return view('admin.article.index',['list'=>$res]);
    }

    public function detail($id){
        $article = Article::find($id);
        var_dump($article->tag_id);

        echo 'article.detail';
}

    public function create(){
        echo 'article.create';
    }

    public function delete(Article $articleModel){
        $id = 1;
        $res = $articleModel->where('id',$id)->delete();
        dump($res);
    }
}